home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / desktop / winrun.zip / WINRUN.TXT < prev   
Text File  |  1991-03-23  |  3KB  |  95 lines

  1.  
  2.               Utility Program to Start Windows 3.0 Applications
  3.               -------------------------------------------------
  4.  
  5. Program:    WINRUN.EXE
  6.  
  7. Features:   Ability to Set Windows Application Startup Directory
  8.             Ability to Set Initial Startup Display Mode of Application
  9.  
  10.  
  11. Background Info:
  12. ----------------
  13.  
  14. To change the default working directory for a Windows Application (WinAp)
  15. you can use file properties and specify the startup directory as the
  16. source for the WinAp you want to run, but you must specify the path
  17. for the WinAp in the PATH environment variable.  For example, to start
  18. Excel in C:\BUDGET you would specify C:\BUDGET\EXCEL.EXE as the command
  19. line and make sure that the PATH variable has C:\EXCEL within it.
  20.  
  21. Problem:
  22. --------
  23.  
  24. The problem with this approach is that the PATH variable begins to suffer
  25. from overload (too many paths).  To get around this, write a program called
  26. WINRUN.EXE as follows and place it in a directory already included in your
  27. PATH such as WINDEV or WINDOWS.
  28.  
  29. Solution:
  30. ---------
  31.  
  32. /*
  33. **  Actual WINRUN.C has code for parsing command line option.  See WINRUN.C
  34. */
  35.  
  36. int PASCAL WinMain
  37.   ( HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
  38.   {
  39.   return WinExec( lpCmdLine, nParam );
  40.   }
  41.  
  42. Now, to use the above example, set the command line in file properties to:
  43.  
  44.     C:\BUDGET\WINRUN.EXE C:\EXCEL\EXCEL.EXE
  45.  
  46. Results:
  47. --------
  48.  
  49. You never have to change the PATH variable again.  Hopefully, the next
  50. version of Windows will ask for the startup directory as a separate
  51. selection within file properties.  Also, it would be helpful to be able
  52. to set the startup mode.
  53.  
  54. Other Options:
  55. --------------
  56.  
  57. In order to change the startup display mode of a Windows 3.0 application
  58. you can use the alternate form of WINRUN.
  59.  
  60.     {directory}WINRUN -option normal_command_line
  61.  
  62. Option Paramater:
  63.  
  64.     STD     Activates the window with default display mode (nCmdShow).
  65.  
  66.     MIN     Activates the window and displays it as iconic.
  67.  
  68.     MAX     Activates the window and displays it as a maximized window.
  69.  
  70. Example:
  71.  
  72.     C:\BUDGET\WINRUN.EXE -MAX C:\EXCEL\EXCEL.EXE
  73.  
  74.     would result in:
  75.  
  76.         Startup Directory:  C:\BUDGET
  77.  
  78.         Display Mode:       EXCEL.EXE would be activate and screen maximized
  79.  
  80.  
  81. Author:
  82. -------
  83. Granted, I didn't actually write any code to build this application, but I
  84. did figure it out.  So for that simple act, I will accept credit.
  85.  
  86. Bob Duffett
  87. Priority Software, Inc.
  88. P.O. Box 5548
  89. Athens, GA  30604
  90.  
  91. (404) 548-4039 Voice
  92. (404) 543-7250 FAX
  93. (404) 543-3162 MHS Hub (PSI-GA)
  94.  
  95.